﻿<UserControl x:Class="TimeSplicerModule.Views.ProjectRoleListView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Width="500" Height="600">
    
    <Grid VerticalAlignment="Top" HorizontalAlignment="Left">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        
        <Border Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5">
            <Button Name="newButton" Content="Add New" Width="125" Height="25" Click="newButton_Click" />
        </Border>
        
        
        <!-- Project Role List -->
        <Border Grid.Column="0" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5">
            <DataGrid ItemsSource="{Binding Path=ProjectRoles}"
                      AutoGenerateColumns="False"
                      CanUserAddRows="False"
                      CanUserDeleteRows="False"
                      IsReadOnly="True"
                      SelectionChanged="DataGrid_SelectionChanged"
                      Style="{StaticResource AzureDataGrid}">

                <DataGrid.Columns>
                    <DataGridTextColumn Header="Project Role" Binding="{Binding Path=Name}"/>
                    <DataGridTextColumn Header="Permission" Binding="{Binding Path=Permission.Name}" />
                    <DataGridTextColumn Header="Description" Binding="{Binding Path=Description}"/>
                    <DataGridTextColumn Header="Hierarchy" Binding="{Binding Path=Hierarchy}" />
                </DataGrid.Columns>
            </DataGrid>
        </Border>
    </Grid>
</UserControl>
